<?php 
    if(!empty($_POST)){
        $year=$_POST['year'];
        if($year==''){
            echo '您没有输入年份';
        }else{
            if(is_numeric($year)){
                $year+=0;
                if(is_int($year)){
                    if($year<1){
                        echo '年份必须正整数';
                    }else{
                        if($year%4==0 && $year%100!=0 || $year%400==0)
                            echo "{$year}是闰年";
                        else
                            echo "{$year}是平年";
                    }
                }else{
                    echo "您输入的不是整数";
                }
            }else{
                echo "您输入的不是数字";
            }
        }
    }
?>
<form action="" method="post">
        请输入年份:<input type="text" name="">
        <input type="submit" name="button" value="判断闰年">
</form>